package com.db.test;

import static org.junit.Assert.*;

import java.util.List;

import javax.swing.DefaultListModel;

import org.junit.Test;

import com.data.Data;
import com.db.bean.Work;
import com.db.service.GroupServer;
import com.db.service.UserServer;
import com.db.service.WorkServer;

/**
* @author 作者:秋哲    E-mail:2810201146@qq.com:
* @version 创建时间：2020年5月29日 上午7:24:46
* @description:   
*/
public class ServerWorkServer {
	public static WorkServer server;
	public  ServerWorkServer() {
		new UserServer().login("12", "213");
		new GroupServer().initGroupList();
		server = new WorkServer();
		testGetWorkList();
		printData();
		System.out.println("构造方法完成");
	}
	public void printData() {
		List<Work> workList = Data.workList;
		for (Work work : workList) {
			System.out.println(work.toString());
		}
	}
	@Test
	public void testUpdateDataWorkList() {
		DefaultListModel<String> updateDataWorkList = server.updateDataWorkList();
		System.out.println(updateDataWorkList.get(1));
	}

	@Test
	public void testGetWorkDetails() {
	}

	@Test
	public void testGetWorkList() {
		server.getWorkList("组1");
	}

//	@Test
//	public void testInsertWork() {
//		server.insertWork("作业4", "详情4", 1);
//		printData();
//	}

	@Test
	public void testDeleteWork() {
		server.deleteWork(8);
		printData();
	}

	@Test
	public void testUpdateWorl() {
		server.updateWorl("作业3。0", "详情3", 14);
		printData();
	}

	@Test
	public void testProductWork() {
		fail("Not yet implemented");
	}

}
